{{:ModuleInclude('public/header')}}

<!-- right content start  -->
<div class="content-right">
    <div class="content">
        <!-- operation start -->
<!--        <div class="am-g am-padding-bottom am-border-bottom-f8 am-margin-bottom">-->
<!--            <div class="am-flex am-flex-justify-between am-flex-items-center am-flex-warp am-gap-12">-->
<!--                <div>-->
                    {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
<!--                        <a href="{{:MyUrl('admin/pluginsadmin/saveinfo')}}" class="am-btn am-btn-primary am-radius am-btn-xs am-margin-right-sm">-->
<!--                            <i class="iconfont icon-btn-add am-show-sm-only"></i>-->
<!--                            <span>{{:MyLang('add_title')}}</span>-->
<!--                        </a>-->
                    {{/if}}
                    {{if AdminIsPower('pluginsadmin', 'upload')}}
<!--                        <button type="button" class="am-btn am-btn-default-plain am-btn-xs am-radius submit-popup" data-url="{{:MyUrl('admin/pluginsadmin/index', ['view_type'=>'upload'])}}" data-title="{{:MyLang('pluginsadmin.base_upload_application_name')}}" data-full-max="1" data-full-max-size="xl">-->
<!--                            <i class="iconfont icon-upload"></i>-->
<!--                            <span>{{:MyLang('pluginsadmin.base_upload_application_name')}}</span>-->
<!--                        </button>-->
                    {{/if}}
<!--                </div>-->
<!--                <div class="am-flex am-flex-items-center am-gap-24">-->
                    {{if !empty($data_list['db_data']) or !empty($data_list['dir_data'])}}
<!--                        <div class="am-input-group am-input-group-sm plugins-search">-->
<!--                            <input type="text" class="am-form-field am-radius" data-is-clearout="0" placeholder="{{:MyLang('pluginsadmin.base_search_input_placeholder')}}" />-->
<!--                            <i class="iconfont icon-search search-event"></i>-->
<!--                        </div>-->
                    {{/if}}
                    {{if AdminIsPower('packageinstall', 'index') and !empty($store_url)}}
                        <a class="am-text-sm am-flex nwarp" href="{{$store_url}}" target="_blank">
                            <i class="iconfont icon-download-btn"></i>
                            <span class="am-hide-sm-only am-margin-left-xs">{{:MyLang('pluginsadmin.base_nav_more_plugins_download_name')}}</span>
                        </a>
                    {{/if}}
<!--                </div>-->
<!--            </div>-->
<!--        </div>-->
        <!-- operation end -->

        <div class="plugins-data-list am-nbfc">
            {{if !empty($data_list['db_data']) or !empty($data_list['dir_data'])}}
                <!-- 操作提示 -->
<!--                <div class="am-operate-stretch-tips">-->
<!--                    <div class="title">-->
<!--                        <i class="iconfont icon-tips"></i>-->
<!--                        <strong title="{{:MyLang('operate_list_tips_msg')}}">{{:MyLang('operate_list_tips_button_text')}}</strong>-->
<!--                        <i class="iconfont icon-contract contract" title="{{:MyLang('operate_list_tips_retract_text')}}"></i> -->
<!--                    </div>-->
<!--                    <p>{{:MyLang('pluginsadmin.base_top_tips_one')}}</p>-->
<!--                    {{if AdminIsPower('pluginsadmin', 'setupsave') or AdminIsPower('packageinstall', 'index')}}-->
<!--                        <p>-->
<!--                            {{if AdminIsPower('pluginsadmin', 'setupsave')}}-->
<!--                                <span>{{:MyLang('pluginsadmin.base_top_tips_two')}}</span>-->
<!--                                <a href="javascript:;" class="am-margin-left iconfont icon-setup submit-move-setup-open"> {{:MyLang('pluginsadmin.base_open_setup_title')}}</a>-->
<!--                                <a href="javascript:;" class="am-margin-left iconfont icon-check submit-move-setup-save am-hide"> {{:MyLang('save_title')}}</a>-->
<!--                                <a href="javascript:;" class="am-margin-left-sm iconfont icon-close-o submit-move-setup-cancel am-hide"> {{:MyLang('cancel_title')}}</a>-->
<!--                            {{/if}}-->
<!--                            {{if AdminIsPower('packageinstall', 'index')}}-->
<!--                                <a href="javascript:;" class="am-margin-left-lg">-->
<!--                                    <label class="am-checkbox-inline plugins-batch-update-submit">-->
<!--                                        <input type="checkbox" value="1" data-am-ucheck {{if !empty($params) and isset($params['is_auto_update']) and $params['is_auto_update'] eq 1}}checked{{/if}} /> {{:MyLang('store_auto_update_name')}}-->
<!--                                    </label>-->
<!--                                </a>-->
<!--                            {{/if}}-->
<!--                        </p>-->
<!--                    {{/if}}-->
<!--                    {{if $is_not_bind_accounts eq 1}}-->
<!--                        <p>-->
<!--                            <span>{{:MyLang('store_bind_accounts_tips')}}</span>-->
<!--                            <button type="button" class="am-btn am-btn-primary am-radius am-btn-xs am-margin-left-xs am-icon-gg store-accounts-event"> {{:MyLang('store_bind_accounts_name')}}</button>-->
<!--                        </p>-->
<!--                    {{/if}}-->
<!--                </div>-->

                {{if !empty($data_list['db_data'])}}
                    <!-- 插件分类 -->
<!--                    <div class="plugins-category-nav am-margin-bottom-lg am-flex am-flex-warp am-gap-12 am-flex-justify-between am-flex-items-center">-->
<!--                        <div class="am-flex am-flex-warp am-gap-12">-->
<!--                            <button type="button" class="am-btn am-btn-secondary am-radius am-btn-xs">{{:MyLang('all_title')}}</button>-->
<!--                            {{if !empty($plugins_categosy_list)}}-->
<!--                                {{foreach $plugins_categosy_list as $cv}}-->
<!--                                    <button type="button" class="am-btn am-btn-default am-radius am-btn-xs" data-value="{{$cv.id}}">{{$cv.name}}</button>-->
<!--                                {{/foreach}}-->
<!--                            {{/if}}-->
<!--                        </div>-->
<!--                        {{if AdminIsPower('pluginscategory', 'index')}}-->
<!--                            <a href="javascript:;" class="am-text-sm submit-popup am-flex" data-url="{{:MyUrl('admin/pluginscategory/index')}}" data-class="plugins-category-save-popup" data-title="{{:MyLang('pluginsadmin.plugins_category_title')}}">-->
<!--                                <i class="iconfont icon-type-manage"></i>-->
<!--                                <span class="am-hide-sm-only am-margin-left-xs">{{:MyLang('pluginsadmin.plugins_category_admin_title')}}</span>-->
<!--                            </a>-->
<!--                        {{/if}}-->
<!--                    </div>-->

                    <!-- 已安装 -->
                    <ul class="already-install am-nbfc" data-setup-save-url="{{:MyUrl('admin/pluginsadmin/setupsave')}}">
                        {{foreach $data_list['db_data'] as $v}}
                            {{if isset($v['is_install']) and $v['is_install'] eq 1 and in_array($v.plugins, ['wallet', 'exchangerate', 'freightfee'])}}
                                <li class="plugins-category-{{$v.plugins_category_id}}" data-id="{{$v.id}}" data-plugins="{{$v.plugins}}">
                                    <div class="item {{if $v['is_enable'] eq 0}}am-active{{/if}}" id="data-list-{{$v.plugins}}">
                                        <!-- 拖拽排序 -->
                                        <div class="submit-move"></div>
                                        <!-- 插件内容 -->
                                        <img src="{{$v.logo}}" class="icon" />
                                        <div class="base">
                                            <h3 class="name">{{$v.name}}</h3>
<!--                                            <div class="am-flex am-flex-items-center am-gap-1">-->
                                                {{if empty($site_store_info) or empty($site_store_info['vip']) or !isset($site_store_info['vip']['status']) or $site_store_info['vip']['status'] eq 0}}
<!--                                                    <p>{{:MyLang('pluginsadmin.data_list_author_title')}}：{{$v.author}}</p>-->
<!--                                                    <p>/</p>-->
<!--                                                    <p class="am-hide-sm-only">{{:MyLang('pluginsadmin.data_list_author_url_title')}}：<a href="{{$v.author_url}}" class="am-pr z-i iconfont icon-home" target="_blank"></a></p>-->
<!--                                                    <p class="am-hide-sm-only">/</p>-->
                                                {{/if}}
<!--                                                <p>{{:MyLang('pluginsadmin.data_list_version_title')}}：{{$v.version}}</p>-->
                                                {{if !empty($upgrade_info) and isset($upgrade_info[$v['plugins']])}}
                                                    {{if !empty($upgrade_info[$v['plugins']]['version_main']) and $upgrade_info[$v['plugins']]['version_main'] neq $v['version']}}
<!--                                                        <p>/</p>-->
<!--                                                        <span class="am-text-danger">v{{$upgrade_info[$v['plugins']]['version_main']}}</span>-->
                                                    {{/if}}
                                                {{/if}}
<!--                                            </div>-->
                                            <div class="desc">{{$v.desc}}</div>
                                        </div>
                                        <div class="operation">
                                            <a href="javascript:;" data-set-url="{{:PluginsAdminUrl($v['plugins'], 'admin', 'index')}}" data-name="{{$v.name}}" data-key="plugins-{{$v.plugins}}" class="am-btn am-btn-default am-btn-xs am-radius plugins-set-event am-padding-left-0">
                                                <i class="iconfont icon-application-set"></i>
                                                <span>{{:MyLang('setup_title')}}</span>
                                            </a>

                                            <a href="javascript:;" class="am-btn am-btn-default am-btn-xs submit-state state-plugins {{if $v['is_enable'] eq 1}}am-success{{/if}}" data-animate="0" data-url="{{:MyUrl('admin/pluginsadmin/statusupdate')}}" data-id="{{$v.plugins}}" data-state="{{$v['is_enable']}}" data-is-update-status="1">
                                                <i class="iconfont icon-enable"></i>
                                                <span>{{:MyLang('status_title')}}</span>
                                            </a>

                                            {{if !empty($upgrade_info) and isset($upgrade_info[$v['plugins']])}}
                                                {{if isset($upgrade_info[$v['plugins']]['version_new']) and version_compare($upgrade_info[$v['plugins']]['version_new'], $v['version'], '>')}}
<!--                                                    <button class="am-btn am-btn-danger am-btn-xs am-radius package-upgrade-event" data-type="plugins" data-name="{{$v.name}}" data-value="{{$v.plugins}}" data-json="{{:urlencode(json_encode($upgrade_info[$v['plugins']]))}}">-->
<!--                                                        <i class="iconfont icon-application-update"></i>-->
<!--                                                        <span>{{:MyLang('update_title')}}</span>-->
<!--                                                    </button>-->
                                                {{/if}}
                                            {{/if}}

                                            {{if isset($v['is_home']) and $v['is_home'] eq true and !empty($v['home_url'])}}
<!--                                                <a href="{{$v.home_url}}" class="am-btn am-btn-default am-btn-xs am-radius" target="_blank">-->
<!--                                                    <i class="iconfont icon-application-home"></i>-->
<!--                                                    <span>{{:MyLang('home_title')}}</span>-->
<!--                                                </a>-->
                                            {{/if}}

                                            {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
<!--                                                <a href="{{:MyUrl('admin/pluginsadmin/saveinfo', array('id'=>$v['plugins']))}}" class="am-btn am-btn-default am-btn-xs am-radius">-->
<!--                                                    <i class="iconfont icon-edit"></i>-->
<!--                                                    <span>{{:MyLang('edit_title')}}</span>-->
<!--                                                </a>-->
                                            {{/if}}
                                            
<!--                                            <button class="am-btn am-btn-default am-btn-xs am-radius submit-ajax" data-url="{{:MyUrl('admin/pluginsadmin/uninstall')}}" data-id="{{$v.plugins}}" data-view="reload" data-msg="{{:MyLang('pluginsadmin.uninstall_confirm_tips')}}">-->
<!--                                                <i class="iconfont icon-application-uninstall"></i>-->
<!--                                                <span>{{:MyLang('uninstall_title')}}</span>-->
<!--                                            </button>-->

                                            {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
<!--                                                <button class="am-btn am-btn-default am-btn-xs am-radius submit-popup" data-url="{{:MyUrl('admin/pluginsadmin/storeuploadinfo', ['id'=>$v['plugins']])}}" data-title="{{:MyLang('upload_title')}}">-->
<!--                                                    <i class="iconfont icon-application-upload"></i>-->
<!--                                                    <span>{{:MyLang('upload_title')}}</span>-->
<!--                                                </button>-->
                                            {{/if}}

                                            {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
<!--                                                <a href="{{:MyUrl('admin/pluginsadmin/download', array('id'=>$v['plugins']))}}" class="am-btn am-btn-default am-btn-xs am-radius">-->
<!--                                                    <i class="iconfont icon-application-download"></i>-->
<!--                                                    <span>{{:MyLang('download_title')}}</span>-->
<!--                                                </a>-->
                                            {{/if}}
                                        </div>
                                        <div class="plugins-setup-container am-padding-main am-hide">
                                            {{if !empty($left_menu)}}
                                                <div class="am-inline-block chosen-select-item">
                                                    <select class="am-radius chosen-select" name="plugins_menu_control" data-placeholder="{{:MyLang('pluginsadmin.plugins_menu_control_title')}}">
                                                        <option value="">{{:MyLang('pluginsadmin.plugins_menu_control_title')}}</option>
                                                        {{foreach $left_menu as $nv}}
                                                            <option value="{{$nv.control}}" {{if isset($v['plugins_menu_control']) and $v['plugins_menu_control'] eq strtolower($nv['control'])}}selected{{/if}}>{{$nv.name}}</option>
                                                        {{/foreach}}
                                                    </select>
                                                </div>
                                            {{/if}}
                                            {{if !empty($plugins_categosy_list)}}
                                                <div class="am-inline-block chosen-select-item">
                                                    <select class="am-radius chosen-select" name="plugins_category_id" data-placeholder="{{:MyLang('pluginsadmin.plugins_category_title')}}">
                                                        <option value="">{{:MyLang('pluginsadmin.plugins_category_title')}}</option>
                                                        {{foreach $plugins_categosy_list as $cv}}
                                                            <option value="{{$cv.id}}" {{if isset($v['plugins_category_id']) and $cv['id'] eq $v['plugins_category_id']}}selected{{/if}}>{{$cv.name}}</option>
                                                        {{/foreach}}
                                                    </select>
                                                </div>
                                            {{/if}}
                                            {{if isset($v['is_home']) and $v['is_home'] eq true}}
                                                <div class="am-inline-block chosen-select-item am-background-white second-domain">
                                                    <label class="am-checkbox-inline" title="{{:MyLang('pluginsadmin.data_list_second_domain_tips')}}">
                                                        <input type="checkbox" name="plugins_is_second_domain" value="1" data-am-ucheck {{if isset($v['plugins_is_second_domain']) and $v['plugins_is_second_domain'] eq 1}}checked="true"{{/if}} /> {{:MyLang('pluginsadmin.data_list_second_domain_title')}}
                                                    </label>
                                                </div>
                                            {{/if}}
                                        </div>
                                    </div>
                                </li>
                            {{/if}}
                        {{/foreach}}
                    </ul>

                    <!-- 搜索无数据展示 -->
                    <div class="not-data-tips am-hide">
                        {{:ModuleInclude('public/not_data')}}
                    </div>
                {{/if}}

                {{if !empty($data_list['dir_data'])}}
                    <!-- 未安装 -->
                    <div class="am-margin-top-lg am-margin-bottom-xs am-nav-left">
                        <span class="am-text-sm am-font-weight">{{:MyLang('pluginsadmin.not_install_divide_title')}}</span>
                    </div>
                    <ul class="not-install am-nbfc" data-setup-save-url="{{:MyUrl('admin/pluginsadmin/sortsave')}}">
                        {{foreach $data_list['dir_data'] as $v}}
                            {{if !isset($v['is_install']) or $v['is_install'] eq 0}}
                                <li data-id="{{$v.id}}" data-plugins="{{$v.plugins}}">
                                    <div class="item am-active" id="data-list-{{$v.plugins}}">
                                        <img src="{{$v.logo}}" class="icon" />
                                        <div class="base">
                                            <h3 class="name">{{$v.name}}</h3>
<!--                                            <div class="am-flex am-flex-items-center am-gap-1">-->
<!--                                                <p>{{:MyLang('pluginsadmin.data_list_author_title')}}：{{$v.author}}</p>-->
<!--                                                <p>/</p>-->
<!--                                                {{if empty($site_store_info) or empty($site_store_info['vip']) or !isset($site_store_info['vip']['status']) or $site_store_info['vip']['status'] eq 0}}-->
<!--                                                    <p class="am-hide-sm-only">{{:MyLang('pluginsadmin.data_list_author_url_title')}}：<a href="{{$v.author_url}}" class="iconfont icon-home" target="_blank"></a></p>-->
<!--                                                    <p class="am-hide-sm-only">/</p>-->
<!--                                                {{/if}}-->
<!--                                                <p>{{:MyLang('pluginsadmin.data_list_version_title')}}：{{$v.version}}</p>-->
<!--                                            </div>-->
                                            <div class="desc">{{$v.desc}}</div>
                                        </div>
                                        <div class="operation">
                                            <button class="am-btn am-btn-default am-btn-xs am-radius submit-ajax" data-url="{{:MyUrl('admin/pluginsadmin/install')}}" data-id="{{$v.plugins}}" data-view="reload" data-msg="{{:MyLang('install_confirm_tips')}}">
                                                <i class="iconfont icon-application-install"></i>
                                                <span>{{:MyLang('install_title')}}</span>
                                            </button>

                                            {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                                                <a href="{{:MyUrl('admin/pluginsadmin/saveinfo', array('id'=>$v['plugins']))}}" class="am-btn am-btn-default am-btn-xs am-radius">
                                                    <i class="iconfont icon-edit"></i>
                                                    <span>{{:MyLang('edit_title')}}</span>
                                                </a>
<!--                                                <button class="am-btn am-btn-default am-btn-xs am-radius submit-popup" data-url="{{:MyUrl('admin/pluginsadmin/storeuploadinfo', ['id'=>$v['plugins']])}}">-->
<!--                                                    <i class="iconfont icon-application-upload"></i>-->
<!--                                                    <span>{{:MyLang('upload_title')}}</span>-->
<!--                                                </button>-->
<!--                                                <a href="{{:MyUrl('admin/pluginsadmin/download', array('id'=>$v['plugins']))}}" class="am-btn am-btn-default am-btn-xs am-radius">-->
<!--                                                    <i class="iconfont icon-application-download"></i>-->
<!--                                                    <span>{{:MyLang('download_title')}}</span>-->
<!--                                                </a>-->
                                            {{/if}}

<!--                                            <button class="am-btn am-btn-default am-btn-xs am-radius submit-delete-modal" data-url="{{:MyUrl('admin/pluginsadmin/delete')}}" data-id="{{$v.plugins}}">-->
<!--                                                <i class="iconfont icon-application-delete"></i>-->
<!--                                                <span>{{:MyLang('delete_title')}}</span>-->
<!--                                            </button>-->
                                        </div>
                                    </div>
                                </li>
                            {{/if}}
                        {{/foreach}}
                    </ul>

                    <!-- 删除弹层 -->
                    <div class="am-modal am-modal-no-btn" tabindex="-1" id="plugins-delete-modal">
                        <div class="am-modal-dialog am-radius am-nbfc">
                            <div class="am-modal-hd">
                                <a href="javascript: void(0)" class="am-close" data-am-modal-close>&times;</a>
                            </div>
                            <div class="am-modal-bd">
                                <div class="am-alert  am-text-left" data-am-alert>
                                    <p>{{:MyLang('pluginsadmin.delete_plugins_text')}}<span class="am-text-warning">{{:MyLang('pluginsadmin.delete_plugins_text_tips')}}</span></p>
                                    <p>{{:MyLang('pluginsadmin.delete_plugins_data_text')}}<span class="am-text-warning">{{:MyLang('pluginsadmin.delete_plugins_data_text_tips')}}</span></p>
                                </div>
                                <p class="am-text-danger am-margin-top">{{:MyLang('pluginsadmin.delete_plugins_ps_tips')}}</p>
                                <div class="am-margin-top-sm">
                                    <button class="am-btn am-btn-danger am-btn-xs am-radius am-icon-circle-o submit-ajax" data-url="{{:MyUrl('admin/pluginsadmin/delete')}}" data-id="0" data-value="1" data-view="reload" data-msg="{{:MyLang('delete_confirm_tips')}}"> {{:MyLang('pluginsadmin.delete_plugins_data_button_name')}}</button>
                                    <button class="am-btn am-btn-warning am-btn-xs am-radius am-icon-remove submit-ajax" data-url="{{:MyUrl('admin/pluginsadmin/delete')}}" data-id="0" data-value="0" data-view="reload" data-msg="{{:MyLang('delete_confirm_tips')}}"> {{:MyLang('pluginsadmin.delete_plugins_button_name')}}</button>

                                    <button class="am-btn am-btn-success am-btn-xs am-radius am-icon-reply" data-am-modal-close> {{:MyLang('pluginsadmin.cancel_delete_plugins_button_name')}}</button>
                                </div>
                            </div>
                        </div>
                    </div>
                {{/if}}

                {{if $is_system_show_base eq 1}}
<!--                    <div class="am-padding-vertical-xl am-text-center">-->
<!--                        <a href="{{$store_url}}" target="_blank" class="am-margin-left-xs">{{:MyLang('pluginsadmin.more_plugins_store_to_text')}}</a>-->
<!--                    </div>-->
                {{/if}}
            {{else /}}
                <div class="table-no">
                    <i class="am-icon-skyatlas am-icon-lg"></i>
                    <p class="am-margin-top-sm">{{:MyLang('plugins_no_data_tips')}}</p>
                    {{if $is_system_show_base eq 1}}
<!--                        <div class="am-margin-top-xl">-->
<!--                            <a href="{{$store_url}}" target="_blank" class="am-margin-left-xs">{{:MyLang('pluginsadmin.no_data_store_to_text')}}</a>-->
<!--                        </div>-->
                    {{/if}}
                </div>
            {{/if}}
        </div>
    </div>
</div>
<!-- right content end  -->

<!-- footer start -->
{{:ModuleInclude('public/footer')}}